home *** CD-ROM | disk | FTP | other *** search
/ Champak 142 / Volume 142 Oct 17 2011 - Damaged.iso / Games / moko-moko.swf / scripts / __Packages / CMG_AS2 / ScoreSubmitter.as < prev    next >
Text File  |  2011-10-17  |  7KB  |  166 lines

  1. if(true)
  2. {
  3.    if(true)
  4.    {
  5.       ┬º┬ºpush(false);
  6.    }
  7.    if(!┬º┬ºpop())
  8.    {
  9.       if(true)
  10.       {
  11.          if(true)
  12.          {
  13.             ┬º┬ºpush(false);
  14.          }
  15.          if(!┬º┬ºpop())
  16.          {
  17.             if(!_global.CMG_AS2)
  18.             {
  19.                _global.CMG_AS2 = new Object();
  20.             }
  21.             ┬º┬ºpop();
  22.             if(!_global.CMG_AS2.ScoreSubmitter)
  23.             {
  24.                var _loc2_ = CMG_AS2.ScoreSubmitter = function()
  25.                {
  26.                }.prototype;
  27.                _loc2_.submitScore = function(playerName, playerScore, playerSpecial)
  28.                {
  29.                   playerName = CMG_AS2.Utilities.trim(playerName);
  30.                   CMG_AS2.ScoreSubmitter.gameVersion = CMG_AS2.Utilities.trim(CMG_AS2.ScoreSubmitter.gameVersion);
  31.                   if(playerSpecial == null)
  32.                   {
  33.                      playerSpecial = "";
  34.                   }
  35.                   else
  36.                   {
  37.                      playerSpecial = CMG_AS2.Utilities.trim(playerSpecial);
  38.                   }
  39.                   CMG_AS2.ScoreSubmitter.gameValidationCode = CMG_AS2.Utilities.trim(CMG_AS2.ScoreSubmitter.gameValidationCode);
  40.                   if(CMG_AS2.ScoreSubmitter.gameId < 1 || CMG_AS2.ScoreSubmitter.gameVersion == "" || CMG_AS2.ScoreSubmitter.gameValidationCode == "")
  41.                   {
  42.                      if(CMG_AS2.ScoreSubmitter.responseHandler != null)
  43.                      {
  44.                         CMG_AS2.ScoreSubmitter.responseHandler(CMG_AS2.ScoreSubmitter.RETURNCODE_REJECTED);
  45.                      }
  46.                      return undefined;
  47.                   }
  48.                   var _loc2_ = new LoadVars();
  49.                   _loc2_.name = playerName;
  50.                   _loc2_.score = playerScore;
  51.                   _loc2_.gameId = CMG_AS2.ScoreSubmitter.gameId;
  52.                   _loc2_.gameVersion = CMG_AS2.ScoreSubmitter.gameVersion;
  53.                   _loc2_.special = playerSpecial;
  54.                   var _loc6_ = new CMG_AS2.MD5();
  55.                   _loc2_.key = _loc6_.calcMD5(playerName + "|" + playerScore + "|" + CMG_AS2.ScoreSubmitter.gameId + "|" + playerSpecial + "|" + CMG_AS2.ScoreSubmitter.gameValidationCode);
  56.                   if(CMG_AS2.ScoreSubmitter.responseHandler != null)
  57.                   {
  58.                      CMG_AS2.ScoreSubmitter.responseHandler(CMG_AS2.ScoreSubmitter.RETURNCODE_WORKING);
  59.                   }
  60.                   _loc2_.sendAndLoad(CMG_AS2.ScoreSubmitter.URL_SUBMITSCORE,_loc2_,"POST");
  61.                   _loc2_.onLoad = function(ok)
  62.                   {
  63.                      if(ok)
  64.                      {
  65.                         var _loc2_ = CMG_AS2.Utilities.trim(this.ok);
  66.                         if(_loc2_ == 1)
  67.                         {
  68.                            if(CMG_AS2.ScoreSubmitter.responseHandler != null)
  69.                            {
  70.                               CMG_AS2.ScoreSubmitter.responseHandler(CMG_AS2.ScoreSubmitter.RETURNCODE_SUCCESS);
  71.                            }
  72.                         }
  73.                         else if(_loc2_ == 0)
  74.                         {
  75.                            if(CMG_AS2.ScoreSubmitter.responseHandler != null)
  76.                            {
  77.                               CMG_AS2.ScoreSubmitter.responseHandler(CMG_AS2.ScoreSubmitter.RETURNCODE_REJECTED);
  78.                            }
  79.                         }
  80.                         else if(_loc2_ == 2)
  81.                         {
  82.                            if(CMG_AS2.ScoreSubmitter.responseHandler != null)
  83.                            {
  84.                               CMG_AS2.ScoreSubmitter.responseHandler(CMG_AS2.ScoreSubmitter.RETURNCODE_WRONGVERSION);
  85.                            }
  86.                         }
  87.                         else
  88.                         {
  89.                            trace("Unknown server response: \'" + this.ok + "\'");
  90.                            if(CMG_AS2.ScoreSubmitter.responseHandler != null)
  91.                            {
  92.                               CMG_AS2.ScoreSubmitter.responseHandler(CMG_AS2.ScoreSubmitter.RETURNCODE_INTERNALERROR);
  93.                            }
  94.                         }
  95.                      }
  96.                      else
  97.                      {
  98.                         trace("Couldn\'t even load the page...\'");
  99.                         if(CMG_AS2.ScoreSubmitter.responseHandler != null)
  100.                         {
  101.                            CMG_AS2.ScoreSubmitter.responseHandler(CMG_AS2.ScoreSubmitter.RETURNCODE_NETWORKERROR);
  102.                         }
  103.                      }
  104.                   };
  105.                };
  106.                CMG_AS2.ScoreSubmitter = function()
  107.                {
  108.                }.loadHighScorePage = function()
  109.                {
  110.                   getURL(CMG_AS2.ScoreSubmitter.URL_VIEWSCORES + "?id=" + CMG_AS2.ScoreSubmitter.gameId,"_blank");
  111.                };
  112.                CMG_AS2.ScoreSubmitter = function()
  113.                {
  114.                }.loadUpdatePage = function()
  115.                {
  116.                   getURL(CMG_AS2.ScoreSubmitter.URL_UPDATEGAME + "?id=" + CMG_AS2.ScoreSubmitter.gameId,"_blank");
  117.                };
  118.                CMG_AS2.ScoreSubmitter = function()
  119.                {
  120.                }.gameId = 0;
  121.                CMG_AS2.ScoreSubmitter = function()
  122.                {
  123.                }.gameVersion = "1.0";
  124.                CMG_AS2.ScoreSubmitter = function()
  125.                {
  126.                }.gameValidationCode = "";
  127.                CMG_AS2.ScoreSubmitter = function()
  128.                {
  129.                }.responseHandler = null;
  130.                CMG_AS2.ScoreSubmitter = function()
  131.                {
  132.                }.URL_VIEWSCORES = "http://scores.crazymonkeygames.com/hs/listscores.php";
  133.                CMG_AS2.ScoreSubmitter = function()
  134.                {
  135.                }.URL_SUBMITSCORE = "http://scores.crazymonkeygames.com/hs/regscores2.php";
  136.                CMG_AS2.ScoreSubmitter = function()
  137.                {
  138.                }.URL_UPDATEGAME = "http://scores.crazymonkeygames.com/hs/pleaseupdate.php";
  139.                CMG_AS2.ScoreSubmitter = function()
  140.                {
  141.                }.RETURNCODE_WORKING = 0;
  142.                CMG_AS2.ScoreSubmitter = function()
  143.                {
  144.                }.RETURNCODE_SUCCESS = 1;
  145.                CMG_AS2.ScoreSubmitter = function()
  146.                {
  147.                }.RETURNCODE_REJECTED = 2;
  148.                CMG_AS2.ScoreSubmitter = function()
  149.                {
  150.                }.RETURNCODE_WRONGVERSION = 3;
  151.                CMG_AS2.ScoreSubmitter = function()
  152.                {
  153.                }.RETURNCODE_NETWORKERROR = 4;
  154.                CMG_AS2.ScoreSubmitter = function()
  155.                {
  156.                }.RETURNCODE_INTERNALERROR = 5;
  157.                ┬º┬ºpush(ASSetPropFlags(CMG_AS2.ScoreSubmitter.prototype,null,1));
  158.             }
  159.             ┬º┬ºpop();
  160.          }
  161.       }
  162.       ┬º┬ºgoto(addr519);
  163.    }
  164. }
  165. addr519:
  166.